﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    >


    <!-- Generic brushes -->
    <SolidColorBrush x:Key="DefaultControlBorderBrush" Color="#FF688CAF"/>
    <SolidColorBrush x:Key="DefaultControlBackgroundBrush" Color="#FFE3F1FE"/>
    <SolidColorBrush x:Key="DefaultControlForegroundBrush" Color="#FF10257F"/>

    <!-- DataGrid related brushes -->
    <SolidColorBrush x:Key="GridLineColorBrush" Color="#FFCEDFF6" />
    <LinearGradientBrush x:Key="AlternateRowBackgroundBrush" StartPoint="0.5,0.0" EndPoint="0.5,1.0">
        <GradientStop Color="#FFFEFEFF" Offset="0"/>
        <GradientStop Color="#FFE4F0FC" Offset="1"/>
    </LinearGradientBrush>

    <!-- Header related brushes -->
    <SolidColorBrush x:Key="HeaderBorderBrush" Color="#88B0E4"/>
    <SolidColorBrush x:Key="HeaderInnerBorderBrush" Color="#FFFFFF" />
    <LinearGradientBrush x:Key="HeaderBackgroundBrush" StartPoint="0.5,0.0" EndPoint="0.5,1.0">
        <GradientStop Color="#FF98BFEB" Offset="0"/>
        <GradientStop Color="#FFB8D4F2" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HeaderHighlightedBackgoundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFA3CBF7" Offset="0"/>
        <GradientStop Color="#FFD9E6F9" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="HeaderPressedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFA3CBF7" Offset="1"/>
        <GradientStop Color="#FFD9E6F9" Offset="0"/>
    </LinearGradientBrush>

    <!-- Value converters -->
    <BooleanToVisibilityConverter x:Key="bool2VisibilityConverter" />

    <!-- 'ColumnHeaderRightGripperStyle' DataGridColumnHeader Right Gripper Style -->
    <Style x:Key="ColumnHeaderRightGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
							    Background="{TemplateBinding Background}"
                                BorderThickness="0">
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- 'ColumnHeaderLeftGripperStyle' DataGridColumnHeader Left Gripper Style -->
    <Style x:Key="ColumnHeaderLeftGripperStyle" 
		   BasedOn="{StaticResource ColumnHeaderRightGripperStyle}" 
		   TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Name="Border"
							    Padding="{TemplateBinding Padding}" 
							    Background="{TemplateBinding Background}"
                                BorderThickness="0">
                        <!--<Canvas>
                                <Line RenderOptions.EdgeMode="Aliased" Stroke="#88B0E4"
								  X1="7" Y1="{Binding ElementName=Border, Path=ActualHeight}"
								  X2="7" Y2="0"/>
                            </Canvas>-->
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- 'ColumnHeaderStyle1' DataGridColumnHeader Style (For Header of type object)-->
    <Style x:Key="ColumnHeaderStyle1" TargetType="{x:Type DataGridColumnHeader}">
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <!--<Setter Property="Background" Value="{StaticResource HeaderBackgroundBrush}"/>-->
        <Setter Property="Background">
            <Setter.Value>
                <!--<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFBCD5DB" Offset="0"/>
                        <GradientStop Color="#FF88D4E4" Offset="1"/>
                        <GradientStop Color="#FFCCDDE0" Offset="0.102"/>
                        <GradientStop Color="#FFAFDDE6" Offset="0.341"/>
                    </LinearGradientBrush>-->
                <LinearGradientBrush StartPoint="0.5646,1" EndPoint="0.5646,-0.0152673">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#FFB4D9F9" Offset="0"/>
                        <GradientStop Color="#FFADDEFB" Offset="0.589041"/>
                        <GradientStop Color="#FFD3E8F4" Offset="0.694064"/>
                        <GradientStop Color="#FFECF7FC" Offset="1"/>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="BorderThickness" Value="0.8,0,0,0"/>
        <Setter Property="BorderBrush" Value="#FFFFFF"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <!--<Setter Property="BorderBrush" Value="{StaticResource HeaderBorderBrush}" />
		    <Setter Property="BorderThickness" Value="0,1,0,1" />-->
        <!--
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                    <Grid>
                        <DataGridHeaderBorder
							x:Name="headerBorder"
							SortDirection="{TemplateBinding SortDirection}"
							IsHovered="{TemplateBinding IsMouseOver}"
							IsPressed="{TemplateBinding IsPressed}"
							IsClickable="{TemplateBinding CanUserSort}"
							Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Padding ="{TemplateBinding Padding}"
							SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
							SeparatorBrush="{TemplateBinding SeparatorBrush}">
                            <Border BorderBrush="White" 
									BorderThickness="0,0,0,0">
                                <ContentPresenter Content="{Binding}"/>
                            </Border>
                        </DataGridHeaderBorder>

                        <Thumb x:Name="PART_LeftHeaderGripper"
							   HorizontalAlignment="Left"
							   Style="{StaticResource ColumnHeaderRightGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper"
							   HorizontalAlignment="Right"
							   Style="{StaticResource ColumnHeaderLeftGripperStyle}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="headerBorder" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5646,1" EndPoint="0.5646,-0.0152673">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FFDEEDFA" Offset="0"/>
                                            <GradientStop Color="#FFCEEBFC" Offset="0.589041"/>
                                            <GradientStop Color="#FFE9F8FE" Offset="0.694064"/>
                                            <GradientStop Color="#FFE9F8FF" Offset="1"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="headerBorder" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5646,1" EndPoint="0.5646,-0.0152673">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FF52BADD" Offset="0"/>
                                            <GradientStop Color="#FF95DBF3" Offset="0.621005"/>
                                            <GradientStop Color="#FFBAE1EF" Offset="0.680365"/>
                                            <GradientStop Color="#FFECF7FC" Offset="1"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        -->
    </Style>


    <!-- 'ColumnHeaderStyle' DataGridColumnHeader Style -->
    <Style x:Key="ColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <!--<Setter Property="Background" Value="{StaticResource HeaderBackgroundBrush}"/>-->
        <Setter Property="Background">
            <Setter.Value>
                <!--<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFBCD5DB" Offset="0"/>
                        <GradientStop Color="#FF88D4E4" Offset="1"/>
                        <GradientStop Color="#FFCCDDE0" Offset="0.102"/>
                        <GradientStop Color="#FFAFDDE6" Offset="0.341"/>
                    </LinearGradientBrush>-->
                <LinearGradientBrush StartPoint="0.5646,1" EndPoint="0.5646,-0.0152673">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#FFB4D9F9" Offset="0"/>
                        <GradientStop Color="#FFADDEFB" Offset="0.589041"/>
                        <GradientStop Color="#FFD3E8F4" Offset="0.694064"/>
                        <GradientStop Color="#FFECF7FC" Offset="1"/>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="BorderThickness" Value="0.8,0,0.0,0"/>
        <Setter Property="BorderBrush" Value="#FFFFFF"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <!--<Setter Property="BorderBrush" Value="{StaticResource HeaderBorderBrush}" />
		    <Setter Property="BorderThickness" Value="0,1,0,1" />-->
        
        <!--<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                    <Grid>
                        <DataGridHeaderBorder
							x:Name="headerBorder"
							SortDirection="{TemplateBinding SortDirection}"
							IsHovered="{TemplateBinding IsMouseOver}"
							IsPressed="{TemplateBinding IsPressed}"
							IsClickable="{TemplateBinding CanUserSort}"
							Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Padding ="{TemplateBinding Padding}"
							SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
							SeparatorBrush="{TemplateBinding SeparatorBrush}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Border BorderBrush="White" 
									BorderThickness="0,0,0,0" Grid.Column="0">
                                <TextBlock
									Text="{Binding}" Margin="4,4,4,4"
									SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
									VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
									HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                                </Border>
                                <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" 
                                    Grid.Column="1" Width="8" Height="6" Fill="Black" Margin="0,0,8,0" 
                                    VerticalAlignment="Center" RenderTransformOrigin="0.5,0.4" />
                            </Grid>
                        </DataGridHeaderBorder>

                        <Thumb x:Name="PART_LeftHeaderGripper"
							   HorizontalAlignment="Left"
							   Style="{StaticResource ColumnHeaderRightGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper"
							   HorizontalAlignment="Right"
							   Style="{StaticResource ColumnHeaderLeftGripperStyle}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="headerBorder" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5646,1" EndPoint="0.5646,-0.0152673">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FFDEEDFA" Offset="0"/>
                                            <GradientStop Color="#FFCEEBFC" Offset="0.589041"/>
                                            <GradientStop Color="#FFE9F8FE" Offset="0.694064"/>
                                            <GradientStop Color="#FFE9F8FF" Offset="1"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="headerBorder" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5646,1" EndPoint="0.5646,-0.0152673">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#FF52BADD" Offset="0"/>
                                            <GradientStop Color="#FF95DBF3" Offset="0.621005"/>
                                            <GradientStop Color="#FFBAE1EF" Offset="0.680365"/>
                                            <GradientStop Color="#FFECF7FC" Offset="1"/>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="SortDirection" Value="Ascending">
                            <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
                            <Setter TargetName="SortArrow" Property="RenderTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="180" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="SortDirection" Value="Descending">
                            <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->
        
    </Style>
    <!-- 'RightAlignedColumnHeaderStyle' Right Aligned DataGridColumnHeader Style-->
    <Style x:Key="RightAlignedColumnHeaderStyle" 
           TargetType="{x:Type DataGridColumnHeader}"
           BasedOn="{StaticResource ColumnHeaderStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
    </Style>
    <!-- 'CenterAlignedColumnHeaderStyle' Center Aligned DataGridColumnHeader Style-->
    <Style x:Key="CenterAlignedColumnHeaderStyle" 
           TargetType="{x:Type DataGridColumnHeader}"
           BasedOn="{StaticResource ColumnHeaderStyle}">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
    </Style>
    <!-- 'RowHeaderGripperStyle' DataGridRowHeader Gripper -->
    <Style x:Key="RowHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Height" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeNS"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
							    Background="{TemplateBinding Background}"
                                BorderThickness="0"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- for every defualt DataGridRowHeader Style -->
    <Style x:Key="{x:Type DataGridRowHeader}"
		   TargetType="{x:Type DataGridRowHeader}">
        <Setter Property="Background" Value="{StaticResource HeaderBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource HeaderBorderBrush}" />
        
        <!--<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridRowHeader}">
                    <Grid>
                        <DataGridHeaderBorder 
							x:Name="headerBorder"
							IsSelected="{TemplateBinding IsRowSelected}"
							IsHovered ="{TemplateBinding IsMouseOver}"
							IsPressed="{TemplateBinding IsPressed}"
							Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="1,0,1,1"
							Padding ="{TemplateBinding Padding}"
							Orientation="Horizontal"
							SeparatorVisibility="{TemplateBinding SeparatorVisibility}"
							SeparatorBrush="{TemplateBinding SeparatorBrush}">
                            <Border BorderBrush="{StaticResource HeaderInnerBorderBrush}"
									BorderThickness="0,1,0,0">
                                <StackPanel Orientation="Horizontal">
                                    <ContentPresenter
										SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
										VerticalAlignment="Center"/>
                                    <Control
										SnapsToDevicePixels="false"
										Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}, Path=(Validation.HasError), Converter={StaticResource bool2VisibilityConverter}}"
										Template="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}, Path=ValidationErrorTemplate}" />
                                </StackPanel>
                            </Border>
                        </DataGridHeaderBorder>

                        <Thumb x:Name="PART_TopHeaderGripper"
							   VerticalAlignment="Top"
							   Style="{StaticResource RowHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_BottomHeaderGripper"
							   VerticalAlignment="Bottom"
							   Style="{StaticResource RowHeaderGripperStyle}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="headerBorder" Property="Background" 
									Value="{StaticResource HeaderHighlightedBackgoundBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="headerBorder" Property="Background" 
									Value="{StaticResource HeaderPressedBackgroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->
        
    </Style>

    <!-- 'Default' Left Aligned DataGridCell Style -->
    <Style x:Key="{x:Type DataGridCell}" TargetType="{x:Type DataGridCell}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border Background="{TemplateBinding Background}" Margin="0" Padding="0">
                        <ContentPresenter  Margin="0" HorizontalAlignment="Stretch"
                                      VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0.5,1.02034" EndPoint="0.5,0.00338901">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FF72BCD5" Offset="0"/>
                                <GradientStop Color="#FF98DCF3" Offset="0.506849"/>
                                <GradientStop Color="#FFB2E8FA" Offset="0.538813"/>
                                <GradientStop Color="#FFCCF2FF" Offset="1"/>
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                
                <!--This will not work here-->
                <!--<Setter Property="BorderThickness" Value="5"/>
                    <Setter Property="BorderBrush" Value="#FF2C99DB"/>-->
                <Setter Property="Foreground" Value="Black"/>
                <Setter Property="FontFamily" Value="Segoe UI"/>
                <Setter Property="FontSize" Value="11"/>
            </Trigger>
            <Trigger Property="IsEditing" Value="True">
                <Setter Property="Background" Value="White"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="DataGridRow.IsFocused" Value="True"/>
                    <Condition Property="IsReadOnly" Value="False"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="White"/>
            </MultiTrigger>            
            <!--<Trigger Property="DataGridRow.IsFocused" Value="True">
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0.5,1.02034" EndPoint="0.5,0.00338901">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FFCFF4FF" Offset="0"/>
                                <GradientStop Color="#FFDDF6FE" Offset="0.520548"/>
                                <GradientStop Color="#FFCAF0FC" Offset="1"/>
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
            </Trigger>-->
        </Style.Triggers>
    </Style>

    <!-- 'DataGridCellDefaultStyle' To focus Left Aligned DataGridCell Style -->
    
    <Style x:Key="DataGridCellDefaultStyle" TargetType="{x:Type DataGridCell}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border Background="{TemplateBinding Background}" Margin="0" Padding="0">
                        <ContentPresenter  Margin="0" HorizontalAlignment="Stretch"
                                      VerticalAlignment="Center"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">                
                <Setter Property="Background" Value="White">
                    <!--Shrey hide this because it show only select cell not row-->
                    <!--<Setter.Value>
                        <LinearGradientBrush StartPoint="0.5,1.02034" EndPoint="0.5,0.00338901">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FF72BCD5" Offset="0"/>
                                <GradientStop Color="#FF98DCF3" Offset="0.506849"/>
                                <GradientStop Color="#FFB2E8FA" Offset="0.538813"/>
                                <GradientStop Color="#FFCCF2FF" Offset="1"/>
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>-->                
                </Setter>                
                <!--This will not work here-->
                <!--<Setter Property="BorderThickness" Value="5"/>
                    <Setter Property="BorderBrush" Value="#FF2C99DB"/>-->
                <Setter Property="Foreground" Value="Black"/>
                <Setter Property="FontFamily" Value="Segoe UI"/>
                <Setter Property="FontSize" Value="11"/>
            </Trigger>
            <Trigger Property="IsEditing" Value="True">
                <Setter Property="Background" Value="White"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="DataGridRow.IsFocused" Value="True"/>
                    <Condition Property="IsReadOnly" Value="False"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="White"/>                
            </MultiTrigger>
            <!--<Trigger Property="DataGridRow.IsFocused" Value="True">
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0.5,1.02034" EndPoint="0.5,0.00338901">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FFCFF4FF" Offset="0"/>
                                <GradientStop Color="#FFDDF6FE" Offset="0.520548"/>
                                <GradientStop Color="#FFCAF0FC" Offset="1"/>
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
            </Trigger>-->
        </Style.Triggers>
    </Style>
    
    <!-- 'LeftAlignedCellStyle' Left Aligned DataGridCell Style -->
    <Style x:Key="LeftAlignedCellStyle" TargetType="{x:Type DataGridCell}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter  Margin="0" HorizontalAlignment="Left"
                                      VerticalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>        
    </Style>
    <!-- 'RightAlignedCellStyle' Right Aligned DataGridCell Style -->
    <Style x:Key="RightAlignedCellStyle" TargetType="{x:Type DataGridCell}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter HorizontalAlignment="Right"
                                      VerticalAlignment="Center"
                                              />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- 'CenterAlignedCellStyle' Center Aligned DataGridCell Style -->
    <Style x:Key="CenterAlignedCellStyle" TargetType="{x:Type DataGridCell}" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter VerticalAlignment="Center"
                                      HorizontalAlignment="Left"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- 'SelectAllButtonTemplate' SelectAllButton ControlTemplate -->
    <ControlTemplate x:Key="SelectAllButtonTemplate" TargetType="{x:Type Button}">
        <Grid>
            <Rectangle x:Name="Border" SnapsToDevicePixels="True"
					   Stroke="{StaticResource HeaderBorderBrush}"
					   Fill="{StaticResource HeaderBackgroundBrush}" />
            <Border SnapsToDevicePixels="True" Margin="1,1,1,0"
					BorderBrush="White" BorderThickness="0,1,0,0" />
            <Polygon x:Name="Arrow"
					 HorizontalAlignment="Right"
					 VerticalAlignment="Bottom"
					 Margin="8,8,3,3"
					 Opacity="0.15"
					 Fill="Black"
					 Stretch="Uniform"
					 Points="0,10 10,10 10,0" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="Border" Property="Fill"
						Value="{StaticResource HeaderHighlightedBackgoundBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="Border" Property="Fill"
						Value="{StaticResource HeaderPressedBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Arrow" Property="Visibility" Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!-- 'DataGridCellsPresenter' DataGridCellsPresenter Style -->
    <Style x:Key="{x:Type DataGridCellsPresenter}" TargetType="{x:Type DataGridCellsPresenter}">
        <!--<Setter Property="Foreground" Value="Black"/>
            <Setter Property="FontFamily" Value="Verdana"/>
            <Setter Property="FontSize" Value="11"/>
            <Setter Property="BorderThickness" Value="1,1,1,1"/>
            <Setter Property="BorderBrush" Value="Black"/>            
            <Setter Property="Padding" Value="3"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,0,0,0"/>-->
        <Setter Property="Height" Value="20"/>
    </Style>
    <!-- DataGrid Style -->
    <Style x:Key="{x:Type DataGrid}" TargetType="{x:Type DataGrid}">
        <Setter Property="Background" Value="{StaticResource DefaultControlBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource DefaultControlForegroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource DefaultControlBorderBrush}" />
        <Setter Property="HorizontalGridLinesBrush" Value="{StaticResource GridLineColorBrush}" />
        <Setter Property="VerticalGridLinesBrush" Value="{StaticResource GridLineColorBrush}" />
        <Setter Property="AlternatingRowBackground" Value="{StaticResource AlternateRowBackgroundBrush}"/>
        <Setter Property="ColumnHeaderStyle" Value="{StaticResource ColumnHeaderStyle}"/>
        <Setter Property="BorderThickness" Value="1" />
        <!-- This is needed to force DG to have a non-default value.  Otherwise the DGR.DetailsVisibility cannot have a value of VisibleWhenSelected by default. -->
        <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected" />
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGrid}">
                    <Border
						Background="{TemplateBinding Background}"
						BorderBrush="{TemplateBinding BorderBrush}"
						BorderThickness="{TemplateBinding BorderThickness}"
						SnapsToDevicePixels="True"
						Padding="{TemplateBinding Padding}">
                        <ScrollViewer Focusable="false" Name="DG_ScrollViewer">
                            <ScrollViewer.Template>
                                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>

                                        <!--Left Column Header Corner -->
                                        <Button 
											Command="{x:Static DataGrid.SelectAllCommand}"
											Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=CellsPanelHorizontalOffset}"
											Focusable="false"
											Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=HeadersVisibility, Converter={x:Static DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static DataGridHeadersVisibility.All}}" 
											Template="{StaticResource SelectAllButtonTemplate}"/>
                                        <!--Column Headers-->
                                        <DataGridColumnHeadersPresenter 
											Grid.Column="1" 
											Name="PART_ColumnHeadersPresenter"
											Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=HeadersVisibility, Converter={x:Static DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static DataGridHeadersVisibility.Column}}"/>

                                        <!--DataGrid content-->
                                        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Grid.Row="1" Grid.ColumnSpan="2" CanContentScroll="{TemplateBinding CanContentScroll}" />

                                        <ScrollBar
											Grid.Row="0" Grid.RowSpan="3" Grid.Column="2" Name="PART_VerticalScrollBar"
											Orientation="Vertical"                                            
											Maximum="{TemplateBinding ScrollableHeight}"
											ViewportSize="{TemplateBinding ViewportHeight}"
											Value="{Binding Path=VerticalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
											Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>

                                        <Grid Grid.Row="2" Grid.Column="1">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=NonFrozenColumnsViewportHorizontalOffset}"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <ScrollBar
												Grid.Column="1"
												Name="PART_HorizontalScrollBar"
												Orientation="Horizontal"
												Maximum="{TemplateBinding ScrollableWidth}"
												ViewportSize="{TemplateBinding ViewportWidth}"
												Value="{Binding Path=HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
												Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ScrollViewer.Template>
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsGrouping" Value="true">
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <!-- DataGridRow Style -->
    <Style x:Key="{x:Type DataGridRow}" TargetType="{x:Type DataGridRow}">
        
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0.5,1.02034" EndPoint="0.5,0.00338901">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FFCFF4FF" Offset="0"/>
                                <GradientStop Color="#FFDDF6FE" Offset="0.520548"/>
                                <GradientStop Color="#FFCAF0FC" Offset="1"/>
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderBrush" Value="#FF87DEE9"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter Property="Background" Value="#FFFFFFFF" />
                <Setter Property="BorderBrush" Value="#FFFFFFFF"/>
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <!--It will not work here-->
                <!--<Setter Property="Background" Value="Black"/>-->
                <Setter Property="BorderThickness" Value="1,1,1,1"/>
                <Setter Property="BorderBrush" Value="#60A6BE"/>
            </Trigger>            
            <!--<EventTrigger RoutedEvent="Mouse.MouseLeave">
        			<BeginStoryboard Storyboard="{StaticResource OnMouseLeave1}" x:Name="OnMouseLeave1_BeginStoryboard3"/>
        		</EventTrigger>-->
            <!--<EventTrigger RoutedEvent="Mouse.MouseEnter">
        			<BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
        		</EventTrigger>-->
        </Style.Triggers>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="BorderThickness" Value="1,1,1,1"/>
        <Setter Property="BorderBrush" Value="#FFFFFFFF"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Margin" Value="0,0,0,0"/>
        <!--<Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridRow}">
                        <StackPanel>
                            <DataGridRowsPresenter
							x:Name="DataGridRowsPresenter1"							
							Background="Black">
                                
                            </DataGridRowsPresenter>
                        </StackPanel>

                    </ControlTemplate>
                </Setter.Value>
            </Setter>-->
    </Style>

</ResourceDictionary>